

  mui('#mui-input-numbox').numbox() // 手动初始化

    var obj = queryStr(window.location.href)

    $.ajax({
        url: '/product/queryProductDetail',
        data: {
            id: obj.id
        },
        success: function (res) {
            console.log(res)

            var size = res.size; //  '35- 36'
            console.log(size)

            var sizeArr = size.split('-')
            console.log(sizeArr);  //["35", "56"]
            var arr = []

            //    把数组 ["35", "56"]  变成  [35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56]
            for (var i = sizeArr[0]; i <= sizeArr[1]; i++) {
                arr.push(i * 1)

            }
            console.log(arr);
            // 重新赋值 把之前的size 替换成新生成的数组
            res.size = arr


            console.log('new', res)

            var detailHtml = template('tmp', res)
            console.log(detailHtml);
            $('#card').html(detailHtml)
        }
    })




    $('#card').on('tap','.sizeNum',function() {

    var sizeNum=$(this).text()
    $(this).addClass('active').siblings().removeClass('active')
    $('.mui-btn-success').attr('mysize',sizeNum)

    })


    $('.mui-btn-success').on('tap',function() {
      var  mysize= $('.mui-btn-success').attr('mysize')
      console.log(mysize);

        //  window.localStorage.setItem('size',mysize)
    
    })


       





